#include <iostream>
#include <string.h>

using namespace std;

class Point
{
public:
    Point();
    ~Point();
    void print();

private:
    int _ix;
    int _iy;
    char *_msg;
};

Point::Point()
    :_ix(0)
     ,_iy(0)
     ,_msg(new char[strlen("default point") + 1])
{
    strcpy(_msg, "default point");
}

Point::~Point()
{
    if(_msg){
        delete []_msg;
    }
    _msg = nullptr;
}

void Point::print()
{
    cout << _msg << endl;
    cout << "(" << _ix << "," << _iy << ")" << endl;
}

void test()
{
    Point p;
    p.print();
    //~Point(); //dangerously
}

int main()
{
    test();
    return 0;
}

